[#ftl]
<html>
  <head>
    <title>AVM Version List</title>
    <link rel="stylesheet" href="${url.context}/css/main.css" TYPE="text/css">
    <script type="text/javascript">
      function validateRequired(field, errorMessageElement, errorMessage)
      {
        var result = true;

        if (field.value == null || field.value == "")
        {
          errorMessageElement.textContent = errorMessage;
          result                          = false;
        }

        return result;
      }

      function validateForm(form)
      {
        var result = true;

        // Reset error messages
        document.getElementById("avmStoreMessage").textContent = "";

        // Now validate each field
        result = validateRequired(form.avmStore, document.getElementById("avmStoreMessage"), "Web Project is mandatory.");

        return result;
      }
    </script>
  </head>
  <body>
    <table>
      <tr>
        <td><img src="${url.context}/images/logo/AlfrescoLogo32.png" alt="Alfresco" /></td>
        <td><nobr>AVM Version List</nobr></td>
      </tr>
      <tr><td><td>Alfresco ${server.edition} v${server.version}
    </table>
    <hr/>
      <p style="color:red">
        <strong>WARNING! WARNING! WARNING!</strong><br/>
        Because the number of versions that a store contains may become very large, this operation can be extremely resource-intensive, to the point of resource exhaustion (ie. Alfresco runs out of memory).
      </p>
    <hr/>
  [#if webProjects?size > 0]
    <form id="listVersionsForm" action="${url.service}" method="POST" onSubmit="return validateForm(this)">
      <table>
        <tr>
          <td align="right">Web Project:</td>
          <td align="left">
            <select name="avmStore">
    [#list webProjects as webProject]
              <option value="${webProject.avmStore}">${webProject.name}</option>
    [/#list]
            </select>
          </td>
          <td id="avmStoreMessage" style="color:red"></td></tr>
        <tr><td colspan="3"><input type="submit" name="submit" value="List Versions" /></td></tr>
      </table>
    </form>
  [#else]
    <p>You do not have any Web Projects configured.</p>
  [/#if]
  </body>
</html>
